package com.demo.controller;

import com.demo.model.SysManagersLoginInfo;
import com.demo.service.SysManagersLoginInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
public class SysManagersLoginInfoController {

    @Resource
    private SysManagersLoginInfoService service;

    @RequestMapping(value = "sys_managers_login_info_view")
    public String sys_managers_login_info_view(String loginname, HttpServletRequest request){
        if(null==loginname){
            loginname = "";
        }
        SysManagersLoginInfo info = new SysManagersLoginInfo();
        info.setLoginname(loginname);
        service.searchpages(info,request);
        request.setAttribute("loginname",loginname);
        return "index/sys_managers_login_info/view";
    }

    @RequestMapping(value = "sys_managers_login_info_del")
    public String sys_managers_login_info_del(String id){
        service.del(id);
        return "redirect:sys_managers_login_info_view";
    }
}
